<%@ page language="java" errorPage="error.jsp" pageEncoding="UTF-8"
	contentType="text/html;charset=utf-8"%>
<%@ include file="Common/taglibs.jsp"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<%@ include file="Common/metalink.jsp"%>
<script src="Scripts/common.js" type="text/javascript"></script>
</head>
<body>
<!-- start of wrapper-->
<div class=" Wrapper">
<%@ include file="Common/header.jsp"%>
<%@ include file="Common/menu.jsp"%>
    <c:set var="bug" value="${dealBean.bug}"></c:set>
    <!-- start of content -->
    <div class="Content">
        <div class="Right">
            <div class="Bugicon Midbox left">
                Bug处理</div>
            <div class="clear">
            </div>
            <!--start of solution-->
            <div class="Solution Insert">
            	<form id="_form" action="dealbug.html" method="post">
            	<input name="dealBean.id" type="hidden" value="${dealBean.id }" />
                <p class="createEdit">
                    <a class="Blue edit" href="copybug.html?id=${dealBean.id }">复制创建新BUG</a>
                    <c:if test="${bug.status <= 1}">
                    <a class="Blue edit" href="toupdbug.html?id=${dealBean.id }">修改</a>
                    <a class="Blue del" href="delbug.html?id=${dealBean.id }" onclick="return confirm('确定要删除吗?');">删除</a>
                    </c:if>
                </p>
                    <p class="Gray box">
                        <label>项目名称</label>
                        <b>${bug.projectName }</b>
                    </p>
                    <p class="Gray box">
                        <label>Bug标题</label>
                        ${bug.id }#&nbsp;${bug.title }
                    </p>
                    <p class="Gray box">
                        <label>创建时间</label>
                        <fmt:formatDate value="${bug.createDate }" type="both"/>
                    </p>
                    <p class="Gray box">
                        <label>模块</label>
						${bug.moduleName }
                    </p>
                    <p class="Gray box">
                        <label>程序</label>
						${bug.programName }
                    </p>
                    <p class="Gray box">
                        <label>优先级</label>
						${bug.priorityName }
                    </p>
                    <p class="Gray box">
                        <label>状态</label>
                        <input name="dealBean.currStatus" type="hidden" value="${bug.status }" />
						${bug.statusName }
                    </p>
                    <p class="Gray box">
                        <label>分配人</label>
                        ${bug.assignerName}
                    </p>
                    <p class="Gray box">
                        <label>处理人</label>
                        ${bug.handlerName}
                    </p>
                    <p class="Gray box">
                        <label>Bug内容</label>
	                    <textarea class="readonly" cols="80" id="bugContent" name="dealBean.bug.bugContent" rows="3" readonly="readonly">${bug.bugContent }</textarea> 
                    </p>
                    <br />
                    <div class="Gray box Detail clear">
                        <label>处理过程</label>
                        <!--start of solution-->
                        <c:if test="${empty dealBean.processList}">
		                	没有过程记录
		                </c:if>
		                <c:if test="${not empty dealBean.processList}">
                        <div class="Solution left">
                            <table border="0" width="100%" cellpadding="10" cellspacing="0" class="bugdetail box">
                            	<c:forEach var="process" items="${dealBean.processList }" varStatus="status" begin="0" end="0">
                                <tr class="title">
                                    <td width="10%">
                                        <span class="BlueBox">${process.statusName }</span>
                                    </td>
                                    <td width="20%">
                                        ${process.assignerName }
                                        <c:if test="${not empty process.handlerName}">
                                        →
                                        ${process.handlerName }
                                        </c:if>
                                    </td>
                                    <td width="50%">
                                    	<c:if test="${not empty process.bugReply}">
                                    	Bug内容:
                                    	<c:if test="${process.bugReply.length() <= 50 }">
                                    		${process.bugReply }
                                        </c:if>
                                        <c:if test="${process.bugReply.length() > 50 }">
                                        	${fn:substring(process.bugReply,0,50) }...
                                        </c:if>
                                        </c:if>
                                    </td>
                                    <td width="20%">
                                        <fmt:formatDate value="${process.replyDate }" pattern="yyyy-MM-dd HH:mm:ss"/>
                                    </td>
                                </tr>
                                <tr class="arrow">
                                    <td colspan="4">
                                    </td>
                                </tr>
                                </c:forEach>
                                <c:if test="${not empty dealBean.processList and dealBean.processList.size() > 2}">
                            	<c:forEach var="process" items="${dealBean.processList }" varStatus="status" begin="1" end="${dealBean.processList.size()-2}">
                                <tr>
                                    <td width="12%">
                                    <c:choose>
			                        	<c:when test="${process.status < 0 }">
					                        <span class="BlueBox">${process.statusName }</span>
			                        	</c:when>
			                        	<c:when test="${process.status == 1 }">
					                        <span class="RedBox">${process.statusName }</span>
			                        	</c:when>
			                        	<c:when test="${process.status == 2 }">
					                        <span class="OrangeBox RedBox">${process.statusName }</span>
			                        	</c:when>
			                        	<c:when test="${process.status >= 3 }">
					                        <span class="RedBox GreenBox">${process.statusName }</span>
			                        	</c:when>
			                        	<c:otherwise>
					                        <span>${process.statusName }</span>
			                        	</c:otherwise>
			                        </c:choose>
                                    </td>
                                    <td width="20%">
                                        ${process.assignerName }
                                        <c:if test="${not empty process.handlerName}">
                                        →
                                        ${process.handlerName }
                                        </c:if>
                                    </td>
                                    <td ${not empty process.bugReply?"class='reply'":"" }>
                                    	<c:if test="${not empty process.bugReply}">
                                    	<c:if test="${process.bugReply.length() <= 50 }">
                                    		${process.bugReply }
                                        </c:if>
                                        <c:if test="${process.bugReply.length() > 50 }">
                                        	${fn:substring(process.bugReply,0,50) }...
                                        </c:if>
                                        </c:if>
                                    </td>
                                    <td width="14%">
                                        <fmt:formatDate value="${process.replyDate }" pattern="yyyy-MM-dd HH:mm:ss"/>
                                    </td>
                                </tr>
                                <tr class="arrow">
                                    <td colspan="4">
                                    </td>
                                </tr>
                                </c:forEach>
                                </c:if>
                                <c:forEach var="process" items="${dealBean.processList }" varStatus="status" begin="${dealBean.processList.size()-1}">                           
                                <tr class="last">
                                    <td width="12%">
                                    <c:choose>
			                        	<c:when test="${process.status == -1 }">
					                        <span class="BlueBox">${process.statusName }</span>
			                        	</c:when>
			                        	<c:when test="${process.status == 1 }">
					                        <span class="RedBox">${process.statusName }</span>
			                        	</c:when>
			                        	<c:when test="${process.status == 2 }">
					                        <span class="OrangeBox RedBox">${process.statusName }</span>
			                        	</c:when>
			                        	<c:when test="${process.status >= 3 }">
					                        <span class="RedBox GreenBox">${process.statusName }</span>
			                        	</c:when>
			                        	<c:otherwise>
					                        <span>${process.statusName }</span>
			                        	</c:otherwise>
			                        </c:choose>
                                    </td>
                                    <td width="20%">
                                        ${process.assignerName }
                                        <c:if test="${not empty process.handlerName}">
                                        →
                                        ${process.handlerName }
                                        </c:if>
                                    </td>
                                    <td ${not empty process.bugReply?"class='reply'":"" }>
                                    	<c:if test="${not empty process.bugReply}">
                                    	<c:if test="${process.bugReply.length() <= 50 }">
                                    		${process.bugReply }
                                        </c:if>
                                        <c:if test="${process.bugReply.length() > 50 }">
                                        	${fn:substring(process.bugReply,0,50) }...
                                        </c:if>
                                        </c:if>
                                    </td>
                                    <td width="14%">
                                        <fmt:formatDate value="${process.replyDate }" pattern="yyyy-MM-dd HH:mm:ss"/>
                                    </td>
                                </tr>
                                </c:forEach>
                            </table>
                        </div>
                        </c:if>
                        <!--end of solution-->
                    </div>
                    <div class="clear">
                        <!-- -->
                    </div>
                    <c:if test="${dealBean.fixFlg or dealBean.approvalFlg }">
					<p class="Gray box NoneBorder">
                        <label>结果</label>
                        <c:if test="${dealBean.fixFlg }">
                        <span class="icon_bigest">
                            <input type="radio" name="dealBean.result" value="1">已解决
						</span> 
                        </c:if>
                        <c:if test="${dealBean.approvalFlg}">
						<span class="icon_bigest">
                            <input type="radio" name="dealBean.result" value="5">承认并关闭
                        </span>
						<span class="icon_bigest">
                            <input type="radio" name="dealBean.result" value="3">未修复
                        </span>
                        </c:if>
                    </p>
                    <p class="Gray box" style="margin-top: 1px;">
                        <label>回复</label>
                        <textarea id="handleContent" name="dealBean.bugReply" cols="80" rows="3"></textarea>                            
                    </p>
                    <p class="Gray box">
                        <label>&nbsp;</label>
                        <a href="javascript:SubmitForm('_form');" class=" Buttom  icon_bigest"><span>提交</span></a>
                    </p>
                    </c:if>
                    <c:if test="${dealBean.forceCloseFlg }">
                    <p class="Gray box">
                        <label>&nbsp;</label>
						<a href="closebug.html?id=${dealBean.id }" class="Buttom icon_bigest"><span>强制关闭该Bug</span></a>
                    </p>
					</c:if>
                    </form>
                    <div class="clear">
                        <!-- -->
                    </div>
            </div>
            <!--end of solution-->
            <div class="left margintop10">
                <a href="javascript:window.close();" class=" Blue">关闭窗口</a>
            </div>
        </div>
        <div class="clear">
            <!-- -->
        </div>
    </div>
	<!-- end of content -->
	<div class="clear">
		<!-- -->
	</div>
	<br />

</div>
<!-- end of wrapper-->
<%@ include file="Common/footer.jsp"%>
</body>
</html>